package com.ticket.sass.common.rpc

import com.ticket.sass.common.entity.tenant.TicketServerConfigEntity
import com.ticket.sass.common.entity.tenant.enums.TicketServerConfigPlatform
import com.ticket.sass.common.rpc.dto.input.ticketserver.OrderTicketRefundInput
import com.ticket.sass.common.rpc.ticketserver.Client
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest
import kotlin.contracts.contract

@SpringBootTest
class CommonRpcApplicationTests {

	@Test
	fun orderTicketRefund() {
		val client = Client().apply {
			setConfig(TicketServerConfigEntity().also {
				it.serverUrl = "http://192.168.3.5:8720"
				it.platform = TicketServerConfigPlatform.CX30
				it.data = """{"appCode":"TESTUSER","cinemaCode":"44001971","secret":"e10adc3949ba59abbe56e057f20f883e"}"""
			})
		}

		val data = client.orderTicketRefund(OrderTicketRefundInput("4400197112057598|2404507051997811", "6927240530000012", "", listOf()))
			.block()

		println(data)
	}

}
